package cn.micai.base.task;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Auther: zhaoxinguo
 * @Date: 2018/7/9 16:28
 * @Description: 所有任务在单一的线程中顺序执行，顺序地执行任务(不要这样做)
 */
public class SingleThreadWebServer {

    public static void main(String [] args) {
        try {
            ServerSocket socket = new ServerSocket(80);
            while (true) {
                Socket connection = socket.accept();
                handleRequest(connection);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void handleRequest(Socket socket) {

    }
}
